package com.campus.controller;

import com.campus.entity.TManagerStudent;
import com.campus.service.ICourseService;
import com.campus.service.IStudentService;
import com.campus.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private IStudentService iStudentService;

    @PostMapping("/create")
    public R createStudent(Integer id, String stuName, String fromPlace, String parentPhone, String currentGrade, Integer loginId, Integer classId)
    {
        return R.success(iStudentService.createStudent(id, stuName, fromPlace, parentPhone, currentGrade, loginId, classId));
    }

    @PostMapping("/createStudents")
    public R createStudents(@RequestBody List<TManagerStudent> studentList)
    {
        return R.success(iStudentService.createStudents(studentList));
    }


}
